<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html>
<html>
<head>
<jsp:include page="../head.jsp"/>
<title>信息工程学院成教管理系统-学生成绩</title>
</head>
<body>
	<div class="container">
		<jsp:include page="../menu.jsp"/>
			<div class="row">
    			<div class="col-md-5">
    				<form class="form-horizontal" method="post" action="studentscoreselectservlet.do">
    					<div class="form-group">
    						<label class="col-md-1 control-label">学年</label>
    						<div class="col-md-4">
    							<select class="form-control" name="year">
    								<c:set var="year" value="${year}"></c:set>
    								<c:forEach items="${times}" var="time">
    								<c:if test="${fn:contains(time,year)}">
    								<option selected="selected">${time}</option>
    								</c:if>
    								<c:if test="${fn:contains(time,year)==false}">
    								<option>${time}</option>
    								</c:if>
    								</c:forEach>
								</select>
							</div>
							<label class="col-md-1 control-label">学期</label>
    						<div class="col-md-4">
    							<select class="form-control" name="term">
									<option value="1">第一学期</option>
									<option value="2">第二学期</option>		
								</select>
							</div>
							<div class="col-md-2">
								<button type="submit" class="btn btn-default btn-sm active">查询</button>
							</div>
						</div>
					</form>
				</div>
			</div>
    		<div class="text-center">
    		<table class="table table-striped table-bordered">
				<tr>
					<td>编号</td>
					<td>课程名</td>
					<td>平时成绩</td>
					<td>期末成绩</td>
					<td>总成绩</td>
					<td>成绩等级</td>
					<!-- <td>任课老师</td> -->
					<td>学期</td>
				</tr>
				
				<c:forEach items="${scores}" var="score" varStatus="i">
				<tr>
					<td>${score.scoreid }</td>
					<td>${score.course.coursename }</td>
					<td>${score.uscore }</td>
					<td>${score.endscore }</td>
					<td>${score.totalscore }</td>
					<td>${score.levelscore }</td>
					<%-- <c:forEach items="${teachers}" var="teacher" varStatus="j">
					<c:if test="${j.index==i.index}">
					<td>${teacher.teachername}</td>			
					</c:if>
					</c:forEach> --%>
					<td>${score.course.term }</td>
				</tr>
				</c:forEach>
		</table>
		</div>
	</div>
</body>
</html>